package com.erp.entity.goods;

import java.io.Serializable;
import java.util.List;

/**
 * 树结构(支持多种泛型类型）
 *
 * @param <T>
 */
public class Tree<T> implements Serializable {
    private Integer id;
    private String label;
    private List<Tree<T>> children;

    public Tree() {
    }

    public Tree(Integer id, String label, List<Tree<T>> children) {
        this.id = id;
        this.label = label;
        this.children = children;
    }

    /**
     * 获取
     *
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置
     *
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取
     *
     * @return label
     */
    public String getLabel() {
        return label;
    }

    /**
     * 设置
     *
     * @param label
     */
    public void setLabel(String label) {
        this.label = label;
    }

    /**
     * 获取
     *
     * @return children
     */
    public List<Tree<T>> getChildren() {
        return children;
    }

    /**
     * 设置
     *
     * @param children
     */
    public void setChildren(List<Tree<T>> children) {
        this.children = children;
    }

    public String toString() {
        return "Tree{id = " + id + ", label = " + label + ", children = " + children + "}";
    }
}
